Conversation
| } | ||
|
|
||
| /** | ||
| * [Advanced] Register a listener to be notified when a stream is ready to read. |
There was a problem hiding this comment.
Why are only adding streams marked as advanced? IMHO if we mark those two we should also mark removeReadStream && removeWriteStream as such. And maybe mention react/stream for easier usage.
There was a problem hiding this comment.
Fair point. I've applied the exact same documentation from the LoopInterface::addReadStream() method:
event-loop/src/LoopInterface.php
Line 8 in 1a709e2
Your suggestion sounds perfectly reasonable, perhaps file this as a follow-up PR to also adjust the interface and the README (similar to #110)? 👍
|
Rebased on |
|
Updated to move deprecation notices out of this PR and split this up into a dedicated PR #231. To ease review, this PR here now only deals with the new static methods. (Merging either PR will likely cause a merge conflict with the other PR, but I'd rather put the burden of rebasing and fixing this conflict onto myself than the people reviewing this.) |
This changeset adds static Loop methods. The Loop class now provides all methods that exist on the LoopInterface as static methods:
This is particularly useful when directly interfacing with the event loop in application code. I've also updated the documentation to highlight some use cases where the
Loop::get()method would still be useful when using dependency injection (DI).Builds on top of #226